package io.focus.mijin.zuul.ratelimit.filters;

import io.focus.mijin.zuul.ratelimit.http.RateLimitHttpServletRequestWrapper;

import javax.servlet.http.HttpServletRequest;

/**
 * 重写zuul的Servlet30RequestWrapper
 *
 * @author 吴爱军
 * @date 2018/5/25
 */
public class RateLimitServlet30RequestWrapper extends RateLimitHttpServletRequestWrapper {
    private HttpServletRequest request;

    RateLimitServlet30RequestWrapper(HttpServletRequest request) {
        super(request);
        this.request = request;
    }

    /**
     * There is a bug in zuul 1.2.2 where HttpServletRequestWrapper.getRequest returns a wrapped request rather than the raw one.
     *
     * @return the original HttpServletRequest
     */
    @Override
    public HttpServletRequest getRequest() {
        return this.request;
    }
}
